package nbcp.filter

import ch.qos.logback.classic.Level
import ch.qos.logback.classic.Logger
import ch.qos.logback.classic.spi.ILoggingEvent
import ch.qos.logback.classic.turbo.TurboFilter
import ch.qos.logback.core.spi.FilterReply
import org.slf4j.Marker
import nbcp.base.extend.AsString
import nbcp.base.extend.LogScope
import nbcp.base.extend.scopes
import nbcp.base.extend.using
import nbcp.base.utils.SpringUtil
import nbcp.web.HttpContext
import java.net.Inet4Address
import java.time.Duration
import java.time.LocalDateTime
import java.util.*
import ch.qos.logback.core.filter.Filter;
import kotlin.collections.LinkedHashMap

class MyTaskLogBackFilter : Filter<ILoggingEvent>() {

    override fun decide(event: ILoggingEvent?): FilterReply {
        //判断是否是在 log 中再 log。
        if( scopes.contains(LogScope.NoLog) || !scopes.contains(LogScope.TaskLog)){
            return FilterReply.DENY
        }

        return FilterReply.NEUTRAL
    }
}